import time

from selenium.webdriver.common.by import By
from selenium import webdriver

web = webdriver.Edge()
web.implicitly_wait(10)

web.get("https://www.byhy.net/cdn2/files/selenium/test2.html")
# 先把已经选中的选项全部点击一下，确保都是未选状态
elements = web.find_elements(By.CSS_SELECTOR,
  '#s_checkbox input[name="teacher"]:checked')

for element in elements:
    element.click()
    time.sleep(3)

# 再点击 小雷老师
web.find_element(By.CSS_SELECTOR,
  "#s_checkbox input[value='小雷老师']").click()
time.sleep(5)